class Solution {
public:
    vector<int> findEvenNumbers(vector<int>& digits) {
        unordered_map<int, int> mp;
        for (auto digit : digits) mp[digit]++;
        vector<int> res;
        for (int i = 100; i < 1000; i += 2) {
            int a = i / 100, b = i / 10 % 10, c = i % 10;
            mp[a]--;
            mp[b]--;
            mp[c]--;
            if (mp[a] >= 0 && mp[b] >= 0 && mp[c] >= 0) {
                res.push_back(i);
            }
            mp[a]++;
            mp[b]++;
            mp[c]++;
        }
        return res;
    }
};
